Microcomputer and processing method of received data

ABSTRACT

A first receiving message is stored into a message box and a CPU reads the first receiving message from the message box. Meanwhile, a second receiving message is once stored in the message box and thereafter transferred in direct to a RAM by a DMA controller. The number of times of transfer operation is restricted with an upper limit value. The CPU does not read the second receiving message from the message box but from the RAM and executes the processes based on the message. Generation of failure in the receiving data fetching processes is reduced without physical expansion of the storage regions of the message box.

CROSS REFERENCE TO RELATED APPLICATION

[0001] This application is based on Japanese Patent Application No. 2001-2615 filed on Jan. 10, 2001 the contents of which are incorporated herein by reference.

BACKGROUND OF THE INVENTION

[0002] 1. Field of the Invention

[0003] The present invention relates to a microcomputer having a function for receiving data and a processing method for received data.

[0004] 2. Description of the Related Art

[0005] It is now an ordinary matter that data communications are conducted among a plurality of microcomputers. For example, a vehicle is usually loaded with electronic control units (hereinafter referred to as ECUs) in the engine drive system, running safety system, entertainment system and other various functional systems to constitute thereby a mobile computer system. Therefore, data communications among such ECUs are effective to realize the optimum control in various systems of a vehicle. For such data communications, there is provided a constitution in which the ECUs loaded in various functional systems are mutually connected via a network such as intra-vehicle LAN (Local Area Network).

SUMMARY OF THE INVENTION

[0006] As shown in FIG. 4, for example, an ECU 100 is loaded in a vehicle. An ordinary ECU is provided with an input/output circuit and a microcomputer but it is also provided for network communication with a driver 110 connected to a LAN 90 as one of the input/output circuit. A microcomputer 120 of the ECU 100 includes a CPU 130, a ROM 140, a RAM 150 and a LAN block 160. The LAN block 160 has a function to fetch communication data from the intra-vehicle LAN 90 via a driver 110 and moreover to transmit the communication data to the intra-vehicle LAN 90.

[0007] Reception of the communication data via the LAN block 160 will be explained in further detail. The LAN block 160 is provided with a message box 160 a, a protocol controller 160 b and a filter circuit 160 c. In this example, the message box 160 a has sixteen blocks. The communication data of the intra-vehicle LAN 90 is constituted of identification information (hereinafter referred to as “ID”) indicating an address of transmission source ECU and a kind of data or the like and communication data itself and thereby it is called a message. The message box 160 a has a structure to store the ID and data itself in pair. In FIG. 4, each message box 160 a is given the numbering from “0” to “15” for the convenience of explanation.

[0008] A message fetched by the driver 110 from the network is first decoded by the protocol controller 160 b and is selected by the filter circuit 160 c. The filter circuit 160 c is a logic circuit to select the message based on the ID explained above. Thereby, the message is stored in any one of the message box 160 a given the numbering from “0” to “15”.

[0009] The CPU 130 reads the message from the message box 160 a on the basis of an interruption signal indicating message reception from the LAN block 160 and stores this message, for example, to the RAM 150 in order to execute the process depending on such message. However, the CPU 130 does not operate depending on only the message from the intra-vehicle LAN 90 and operates depending on the signals from the other input circuits. Accordingly, the CPU 130 preferentially executes the process which is in the higher real-time processing level by conducting the process change-over operation such as the task dispatch or the like. As a result, when the process priority of the message received is relatively lower, even if the interruption signal is received, the message cannot always be obtained immediately from the message box 160 a.

[0010] Meanwhile, a communication rate has been much improved in the intra-vehicle LAN 90. For example, this communication rate has reached several Mbps. Therefore, here is generated an event that the next message is received before the CPU 130 fetches a message from the one message box 160 a and thereby the next message is over-written in the message box 160 a during the fetching process of message. That is, the CPU 130 accidentally generates, in a certain case, a failure of the message fetching process. Such failure of the message fetching process is not desirable from the viewpoint of performance of the CPU 130 because it surely results in deterioration of control performance thereof. For prevention of the failure of the message fetching process, it is very effective that a plurality of message boxes are assigned, for example, to store groups of the messages having comparatively lower process priority and the messages are stored in the vacant storage areas among a plurality of message boxes. In FIG. 4, thirteen message boxes 160 a which are identified with the numbering from “1” to “13” are assigned, for example, for the groups of messages having comparatively lower process priority, the messages are selected by the filter circuit 160 c and the selected messages are stored in the vacant message boxes 160 a among the thirteen message boxes 160 a. Thereby, if a delay time is generated in the read operation of message by the CPU 130, generation of the failure in the message fetching process is reduced because the thirteen messages in maximum are stored.

[0011] However, since the number of message boxes is restricted, the message boxes are probably used completely when the received messages are spread to various kinds and the communication rate is comparatively higher. Here, it is considered to increase the number of message boxes to provide a countermeasure, but it is actually difficult to realize because of the following reasons. The required number of message boxes is different depending on the frequency of message reception and moreover on the number of messages as the reception object. Accordingly, the structure of the LAN block becomes large in size and thereby a size of ECU becomes large when the message boxes in the number enough for no limitation of application purpose are used. In addition, expansion in size of the message box is related only to expansion of a communication function and does not make any contribution to improvement of flexibility of a microcomputer itself. Therefore, such expansion of the message box results in a larger demerit that the manufacturing cost increases.

[0012] An object of the present invention is to overcome the problems explained above.

[0013] Another object of the present invention is to reduce generation frequency of failure in the communication data fetching process.

[0014] The other object of the present invention is to eliminate occurrence of such failure in the communication data fetching process

[0015] The still other object of the present invention is to reduce generation frequency of failure in the communication data fetching process without any expansion of storage region of a data storage means, for example, a message box.

[0016] According to a profile of the present invention, a microcomputer is provided with a communication means, a data storage means and a process executing means. Moreover, a transfer means transfers communication data stored in the particular storage region of the data storage means. A transfer destination is selected to a temporary storage means which is used by the process executing means. This transfer means transfer the communication data in direct without passing the process executing means in the matter that the storage region of the transfer destination is never overlapped. The process executing means basically reads the communication data from the data storage region to execute the processes based on the relevant communication data but executes the processes based on the communication data stored in the particular storage region depending on the communication data stored in the temporary storage means. Since the transfer process is executed by way of no process executing means, the transfer process can be done independent of various processes executed by the process executing means. Moreover, since communication data is transferred without any overlapping of the storage region in the transfer destination, over-writing of communication data is prevented during the transfer operation of communication data.

[0017] The communication means is provided with at least a data receiving function. Moreover, the communication means is permitted to include both receiving function and transmission function. The transfer process can be executed during the period until the next communication data is over-written from the time when the communication data is stored in the particular storage region of the data storage means.

[0018] Here, the number of times of communication data transfer may be limited in view of preventing that the transfer data excessively occupies the storage region of the temporary storage means. Moreover, it is possible to introduce the construction to notify the number of times of transfer or that the number of times of transfer has reached the preset value. In addition, information to control the notification process may be held in the transfer means. Further, it is possible to form a constitution to change the upper limit value in the number of times of transfer and the preset value from the process executing means.

BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Features and advantages of embodiments will be appreciated, as well as methods of operation and the function of the related arts, from a study of the following detailed description, the appended claims, and the drawings, all of which from a part of this application. In the drawings:

[0020]FIG. 1 is a block diagram of a control system of a vehicle according to a first embodiment of the present invention;

[0021]FIG. 2 is a block diagram of an electric control unit according to the first embodiment of the present invention;

[0022]FIG. 3 is a block diagram of a microcomputer according to the first embodiment of the present invention; and

[0023]FIG. 4 is a block diagram of an electric control unit showing a conventional configuration.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0024] A preferred embodiment of the present invention will be explained with reference to the accompanying drawings. In this embodiment, the present invention has been adapted to a control system loaded to a vehicle.

[0025] In FIG. 1, the control system is loaded to a vehicle. This control system comprises a plurality of ECUs 10 and intra-vehicle LAN 90 to realize data communication among the ECUs 10. Each ECU 10 controls various control objects, for example, doors and windows. For example, an ECU for body system provided within the vehicle, an ECU for engine system, an ECU for drive system, an ECU for running safety system and an ECU for entertainment system or the like are loaded. Each ECU 10 is constructed to execute the predetermined programs in order to control the control objects and moreover executes, as required, the data communication among the ECUs explained above via the intra-vehicle LAN 90 in order to realize optimum control for the entire part of vehicle.

[0026] The ECU 10 comprises a driver 11 and a microcomputer 12. The driver 11 connects the microcomputer 12 to the intra-vehicle LAN 90. The microcomputer 12 is the well known typical computer system. The microcomputer 12 includes a CPU 13 as the process executing means, a ROM 14 as the program storage means, a RAM 15 as the temporary storage means, a LAN block 16 and a DMA (Direct Memory Access) controller 17 as the transfer means.

[0027] The LAN block 16 includes a message box 16 a, a protocol controller 16 b and a filter circuit 16 c.

[0028] The communication data to be transmitted and received via the intra-vehicle LAN 90 is constituted of identification information (ID) and data itself (DATA) and is called a message. The message box 16 a is a storage region to hold a transmitting message or a receiving message. In FIG. 2, a structure to store the message is shown in correspondence between ID and DATA. Moreover, the message boxes 16 a are given the numbering from “0” to “15” for identification thereof.

[0029] The protocol controller 16 b executes the message process depending on the communication protocol. For example, the message stored in the message box 16 a for transmission is outputted to the driver 11. In this embodiment, one message box 16 a which is given the number “0” is used for transmission.

[0030] Moreover, the protocol controller 16 b decodes the message received via the driver 11. The decoded message is stored in the message box 16 a for reception depending on the result of selection by the filter circuit 16 c. In this embodiment, fifteen message boxes 16 a given the numbering from “1” to “15” are used for reception. The protocol controller 16 b is the communication means, while the message box 16 a is the storage region of the data storage means.

[0031] The ID is address information to identify the ECU 10 serving as the transmission source of communication data or significant information which indicates a kind of the communication data. Message selection is executed on the basis of the ID. The filter circuit 16 c is constructed as a logic circuit including three filter patterns of mask 0 to mask 3. These three filter patterns are used to identify the ID and select the message. The filter circuit 16 c operates as a selection means.

[0032] The filter patterns of mask 0 correspond to the thirteen message boxes 16 a given the numbering from “1” to “13”. The message selected based on the mask 0 is stored in the vacant message box 16 a among the thirteen message boxes 16 a given the numbering from “1” to “13”. The filter pattern of mask 1 corresponds to the message box 16 a of the number “14”. The message selected based on the mask 1 is stored in the message box 16 a of the number “14”. The filter pattern of mask 2 corresponds to the message box 16 a of the number “15”. The message selected based on the mask 2 is stored in the message box 16 a of the number “15”.

[0033] Groups of the messages selected based on three filter patterns of the masks 0 to 3 are respectively determined taking the process priority thereof into consideration. In this embodiment, the mask corresponds to the level of the process priority. Groups of the messages having higher process priority are selected based on the mask 2, groups of the messages having intermediate process priority are selected based on the mask 0, while groups of the messages having lower process priority are selected based on the mask 1. Therefore, the messages having higher process priority are stored in the message box 16 a of the number “15”, the messages having intermediate process priority are stored in the message boxes 16 a of the numbering from “1” to “13” and the messages having lower process priority are stored in the message box 16 a of the number “14”. In this embodiment, the messages having higher and intermediate process priority are defined as the first receiving messages and the messages having lower process priority as the second receiving messages.

[0034] The DMA controller 17 transfers, when the message is stored in the message box 16 a of the number “14”, this message to the RAM 15. Thereby, occurrence of a failure in the message fetching process for the message to be stored in the message box 16 a for reception is reduced.

[0035] Constitutions the LAN block 16 and DMA controller 17 will be explained with reference to FIG. 3. The DMA controller 17 is provided with nine registers 17 a to 17 i and is capable of setting various information pieces in relation to the message transfer operation. Setting of these information pieces can be changed from the CPU 13 with inclusion of the following contents.

[0036] First, selection information regarding regular transfer and LAN transfer is stored in the register 17 a. When the selection information indicates the LAN transfer, transfer is executed to the RAM 15 from the message box 16 a of the number “14”. On the other hand, when the selection information indicates the regular transfer, the regular transfer process is carried out among the memories such as the RAM 15 or the like.

[0037] To the register 17 b, a transfer source address is stored. This transfer source address is a transfer source address for the regular transfer operation. To the register 17 c, a transfer destination address is stored. However, this transfer destination address is used not only for the regular transfer operation but also as a transfer destination for the LAN transfer operation. To the register 17 d, the upper limit value of the number of times of transfer is stored. For example, “100” is stored. To the register 17 i, the number of times of transfer operation is stored. This number of times of transfer operation is counted in every execution of the transfer operation. When the number of times of transfer operation becomes equal to the upper limit value, the DMA controller 17 stops the transfer operation.

[0038] To the register 17 e, a direction of transfer operation is stored. This transfer direction is information indicating that the transfer operation should be executed in the forward direction from the transfer destination address stored in the register 17 c with decrement of the address or in the backward direction from the transfer destination address with increment of the address.

[0039] To the register 17 f, information to permit/inhibit generation of an interruption during the transfer operation is stored. The DMA controller in this embodiment notifies the preset interruption generation timing to the CPU 13. The interruption generation timing is stored in the register 17 h. In more practical, an arbitrary setting value can be stored. For example, two values of “50”, which is equal to a half of the upper limit value and “100” which is equal to the upper limit value may be set as the setting value. Moreover, the DMA controller 17 outputs, when the number of times of transfer operation in the register 17 i becomes equal to the setting value, an interruption signal to the CPU 13 in order to notify that the number of times of transfer operation becomes equal to the setting value.

[0040] To the register 17 g, transfer source information for identifying the message box 16 a of the transfer source is stored. This information is used in the LAN transfer explained above. In this embodiment, the information to identify the message box 16 a of the number “14” is stored to the register 17 g.

[0041] The LAN block 16 stores transmission/reception operation information 16 d, transmission/reception condition information 16 eand interruption permission/inhibition information 16 f. Next, a relationship between these information pieces and the message box 16 a, protocol controller 16 b and filter circuit 16 c will be explained.

[0042] The transmission/reception operation information 16 d indicates the message boxes used for transmission and that for reception among the sixteen message boxes 16 a. The transmission/reception condition information 16 e, is flag information indicating the end of transmission at the message boxes 16 a for transmission and the end of reception at the message boxes 16 a for reception. When a flag indicating the end of transmission is set, it means that the message read from the message box 16 a is transmitted by the protocol controller 16 b, while when a flag indicating the end of reception is set, it means that the receiving message is stored into the message box 16 a by the protocol controller 16 b. Therefore, it is possible to identify the message box 16 a to which the receiving message is stored by this transmission/reception condition information 16 e. The DMA controller 17 is connected with a signal line shown with a code a in order to monitor the transmission/reception condition information 16 e.

[0043] The interruption permission/inhibition information 16 fis flag information indicating that an interruption to the CPU 13 should be generated or not at the end of the transmission/reception of each message box 16 a. The LAN block 16 executes the AND operation for the flag information of the transmission/reception condition information 16 eand the interruption permission/inhibition information 16 fand outputs a result of this AND operation to an interruption generation circuit 18. Thereby, only when generation of interruption is permitted, an interruption signal is outputted to the CPU 13 at the end of the transmission/reception of a message.

[0044] Next, an operation to fetch a message from the message box 16 a in the microcomputer 12 will be explained.

[0045] First, the CPU 13 executes the initialization process. The CPU 13 outputs information for selecting the LAN transfer to the DMA controller 17. This information is stored in the register 17 a. The CPU 13 notifies an instruction to permit transfer operation to the DMA controller 17. Thereby, the DMA controller 17 enters the transfer ready condition.

[0046] The CPU 13 reads the receiving messages of the message boxes 16 a of the numbers “1” to “13” and “15” and then stores the messages to the RAM 15 shown in FIG. 2 in order to execute the processes based on these messages. Therefore, the CPU 13 can execute the processes without any failure in the message fetching process for the receiving data.

[0047] On the other hand, the DMA controller 17 monitors the transmission/reception condition information 16 eof the LAN block 16 for the message box 16 a of the number “14”. Therefore, when a message is stored, the DMA controller 17 transfers this message to the RAM 15. In more detail, the message is transferred in the direction stored in the register 17 e from the transfer destination address stored in the register 17 c. Successively, a message is transferred repeatedly whenever a new message is stored in the message box 16 a of the number “14” until the number of times of transfer reaches the upper limit value, for example, “100” stored in the register 17 d. The DMA controller 17 stops the transfer process when the CPU 13 issues an instruction to stop the transfer process.

[0048] The CPU 13 never reads a message from the message box 16 a, in regard to the message stored in the message box 16 e of the number “14” but reads the such message after it is transferred from the RAM 15 and thereafter executes the processes based on such message. This process is not always executed whenever the data of lower process priority is received but is executed periodically or irregularly in the interval of the upper limit value or less.

[0049] The ECU 10 of this embodiment is constructed to store the messages corresponding to the upper limit value of the number of times of transfer process, for example, “100” messages by transferring the messages of the lower process priority to be stored in the message box 16 a of the number “14” to the RAM 15 from the DMA controller 17. That is, virtual expansion of the message box 16 a is realized by the transfer from the DMA controller 17 to the RAM 15. Thereby, generation of failure in the message fetching process for the received messages is reduced by increasing the number of message boxes 16 a of the LAN block 16. As a result, the ECU 10 can faithfully execute the control based on the message and thereby prevents deterioration of the control performance thereof.

[0050] In this embodiment, the DMA controller 17 is required and this DMA controller 17 can be flexibly used for the other data transfer processes by updating the selection information in the register 17 a. This flexibility is a merit from the point of view of cost. The microcomputer comprising the DMA controller 17 is already put into the practical use and is easily available in the market. This embodiment provides a large merit from the viewpoint of manufacturing cost in the characteristic that functions may be expanded through improvement of software using the existing microcomputer.

[0051] Moreover, in this embodiment, the upper limit value of the number of times of transfer process can be stored in the register 17 d of the DMA controller 17 and when the number of times of transfer process stored in the register 17 i reaches the upper limit value, the transfer operation is automatically stopped. In addition, when the number of times of transfer process reaches the setting value stored in the register 17 h under the precondition that generation of interruption is permitted by the information in the register 17 f, this condition is notified to the CPU 13. Thereby, when the CPU 13 issues an instruction to stop the transfer process, the DMA controller 17 stops the transfer process. Moreover, only when the CPU 13 has issued an instruction to permit the transfer process, the DMA controller 17 enters the transfer ready state. With these processes, the transfer process can be stopped in the course of the process when an inadequate transfer process is executed based on any uncertain factor. As a result, the storage region of the RAM 15 is no longer 

What is claimed is:
 1. A microcomputer comprising a communication means for receiving at least communication data from a network, a data storage means including the predetermined number of storage regions to store communication data received by the communication means and a process executing means for executing processes based on the communication data stored in the data storage means, wherein there is further provided a transfer means which transfers, by no way of the process executing means, the communication data stored in the particular storage region of the data storage means to a temporary storage means that is used by the process executing means in the manner that the storage regions in the transfer destination are not overlapped, and the process executing means executes the processes depending on the communication data stored in the particular storage region on the basis of the communication data stored in the temporary storage means.
 2. A microcomputer according to claim 1, wherein the transfer means is a DMA controller.
 3. A microcomputer according to claim 1, wherein the transfer means holds the number of times of transfer of the communication data.
 4. A microcomputer according to claim 3, wherein the transfer means stops transfer operation of the communication data when the number of times of transfer operation reaches an upper limit value.
 5. A microcomputer according to claim 3, wherein the transfer means notifies information to the process executing means when the number of times of transfer operation reaches the preset value.
 6. A microcomputer according to claim 1, wherein the transfer means stops the transfer operation of the communication data when it is instructed from the process executing means to stop the transfer operation.
 7. A microcomputer according to claim 1, wherein the transfer means enters the condition being ready for transfer of the communication data when it is permitted to transfer of data from the process executing means.
 8. A microcomputer according to claim 1, wherein information to identify the particular storage region of the data storage means is set as transfer source information and the transfer means transfers the communication data when the communication data is stored in the storage region identified by the transfer source information.
 9. A microcomputer according to claim 1, wherein communication data having a relatively lower process priority is stored in the particular storage region.
 10. A microcomputer according to claim 1, wherein the communication data is constituted of identification information to identify a transfer source apparatus or a kind of data and a main part of data and there is further provided a selecting means for selecting the communication data depending on the identification information.
 11. A microcomputer according to claim 1, wherein the communication means transmits communication data to the network.
 12. A microcomputer according to claim 1, wherein the network is an intra-vehicle LAN.
 13. A communication data processing method, in which a plurality of kinds of communication data received from a network is stored into a message box as receiving data and a processing means executes processes depending on the receiving data, comprising the steps of: identifying a kind of the receiving data; temporarily storing the receiving data of a first kind by over-writing to a first message box whenever the data is received; reading the receiving data of the first kind stored temporarily from the first message box by the processing means and executing the first process by the processing means depending on the receiving data of the first kind, temporarily storing the receiving data of a second kind by over-writing to a second message box whenever the data is received; accumulating and storing a plurality of the receiving data of the second kind by transferring, in direct and sequentially, the receiving data of the second kind stored temporarily to a plurality of memory regions by no way of the processing means; and executing the second process depending on the receiving data of the second kind by the processing means based on the receiving data of the second kind accumulated in the memory region.
 14. A communication data processing method according to claim 13, wherein the first process is executed whenever the receiving data of the first kind is received and the second process is not executed whenever the receiving data of the second kind is received.
 15. A communication data processing method according to claim 14, wherein the first process is executed in preference to the second process.
 16. A communication data processing method according to claim 13, wherein the number of the receiving data of the second kinds to be accumulated is limited. 